<?php /* Smarty version 2.6.18, created on 2009-11-02 03:29:42
         compiled from invRejectReport.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'invRejectReport.tpl', 117, false),array('modifier', 'number_format', 'invRejectReport.tpl', 125, false),)), $this); ?>
<script type="text/javascript">	
	<?php echo '
		Calendar.setup({
	        inputField     :    "cal[reject_date_from]",     // id of the input field
	        ifFormat       :    "%Y-%m-%d" ,    // format of the input field
	        displayArea    :    "reject_date_from",
	        daFormat       :    "%Y-%m-%d",      // format of the display area
	        button         :    "f_trigger_c1",  // trigger for the calendar (button ID)
	        align          :    "Bl",           // alignment (defaults to "Bl")
	        singleClick    :    true,
			//onUpdate	   :    endDateChanged, //event to call after calendar is closed
	        weekNumbers    :    false,
	        zIndex		   :	2000
	    });
	'; ?>

	<?php echo '
		Calendar.setup({
	        inputField     :    "cal[reject_date_to]",     // id of the input field
	        ifFormat       :    "%Y-%m-%d" ,    // format of the input field
	        displayArea    :    "reject_date_to",
	        daFormat       :    "%Y-%m-%d",      // format of the display area
	        button         :    "f_trigger_c2",  // trigger for the calendar (button ID)
	        align          :    "Bl",           // alignment (defaults to "Bl")
	        singleClick    :    true,
			//onUpdate	   :    endDateChanged, //event to call after calendar is closed
	        weekNumbers    :    false,
	        zIndex		   :	2000
	    });
	'; ?>

</script>
<div id="main_content">
    	<h1>Inventory Reject Report</h1>
			<div class="blue">
        	    <form action="" id="filterForm" >
        	        <table>
        	            <tr>
        	                <td><label for="filter">Tanks:</label></td>
        	                <td><select name="user[tank]" onchange="doajaxAction('/account/orgInvRejectReport/reload/1',1,'result',document.getElementById('filterForm'))">
            	                <option value="">All Tanks</option>
        	                    <?php $_from = $this->_tpl_vars['orgTanks']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['tank']):
?>
        	                        <option value="<?php echo $this->_tpl_vars['tank']['tank_id']; ?>
"><?php echo $this->_tpl_vars['tank']['name']; ?>
</option>
        	                    <?php endforeach; endif; unset($_from); ?>
        	                </select></td>
        	            </tr>
        	            <tr>
        	                <td><label for="filter">MOID:</label></td>
        	                <td><select name="user[moid]" onchange="doajaxAction('/account/orgInvRejectReport/reload/1',1,'result',document.getElementById('filterForm'))">
        	                    <option value="">All Species</option>
        	                    <?php $_from = $this->_tpl_vars['moids']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['moid']):
?>
        	                        <option value="<?php echo $this->_tpl_vars['moid']['moid']; ?>
"><?php echo $this->_tpl_vars['moid']['moid']; ?>
</option>
        	                    <?php endforeach; endif; unset($_from); ?>
        	                </select></td>
        	            </tr>
        	            <tr>
        					<td><label for="filter">Reason:</label></td>
        					<td><select name="user[reject_reason]" onchange="doajaxAction('/account/orgInvRejectReport/reload/1',1,'result',document.getElementById('filterForm'))">
        						<option value="">All Reasons</option>
        						<?php $_from = $this->_tpl_vars['rejectReasons']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['reject']):
?>
        							<option value="<?php echo $this->_tpl_vars['reject']['reject_reason_id']; ?>
"><?php echo $this->_tpl_vars['reject']['reason']; ?>
</option>
        						<?php endforeach; endif; unset($_from); ?>
        					</select></td>
        	            </tr>
        	            <!-- <tr>
        	                <td><label for="filter">Record From:</label></td>
        	                <td>
        						<input name="user[reject_date_from]" type="text" size="10" onchange="doajaxAction('/account/orgInvRejectReport/reload/1',1,'result',document.getElementById('filterForm'))">&nbsp;&nbsp;&nbsp;to:&nbsp;
        						<input name="user[reject_date_to]" type="text" size="10" onchange="doajaxAction('/account/orgInvRejectReport/reload/1',1,'result',document.getElementById('filterForm'))">
        	                </td>
        	            </tr> -->
        	            <tr>
        	                <td style="width: 100px" nowrap><label for="filter">Record From:</label></td>
        	                <td nowrap>
        						<input style="float:left" type="hidden" name="user[reject_date_from]" id="cal[reject_date_from]" size="10"  onchange="doajaxAction('/account/orgInvRejectReport/reload/1',1,'result',document.getElementById('filterForm'))"/>
								<span id="reject_date_from"  style="width:80px; display:block; float:left; height:15px; text-align:center;"></span>
								<input style="float:left" type="image" src="/app/default/www/images/calendar.jpg" align="absmiddle" id="f_trigger_c1" style="cursor: pointer; border: 0px ;" title="Date selector"/>
								<input type="hidden" name="dateYui" value="cal[reject_date_from]/reject_date_from/f_trigger_c1">
						</tr>
						<tr>
							<td style="width: 100px" nowrap><label for="filter">Record To:</label></td>
							<td nowrap><input style="float:left" type="hidden" name="user[reject_date_to]" id="cal[reject_date_to]" size="10"  onchange="doajaxAction('/account/orgInvRejectReport/reload/1',1,'result',document.getElementById('filterForm'))"/>
								<span id="reject_date_to"  style="width:80px; display:block; float:left; height:15px; text-align:center;"></span>
								<input style="float:left" type="image" src="/app/default/www/images/calendar.jpg" align="absmiddle" id="f_trigger_c2" style="cursor: pointer; border: 0px ;" title="Date selector"/>
								<input type="hidden" name="dateYui" value="cal[reject_date_to]/reject_date_to/f_trigger_c2">
        	                </td>
        	            </tr>
        	            <tr>
        					<td><label for="filter">Trans Type:</label></td>
        					<td><select name="user[transaction_source]" onchange="doajaxAction('/account/orgInvRejectReport/reload/1',1,'result',document.getElementById('filterForm'))">
        						<option value="">All Types</option>
        						<option value="1">No Transaction</option>
        						<option value="PO">PO Only</option>
        						<option value="Transfer">Transfer Only</option>
        						<option value="Return">Return Only</option>
        					</select></td>				
        	            </tr>
        	        </table>
        	    </form>
        	</div>
 
            <div id="result">
				<div>
					<table border="0" width="100%">
					<tr><td colspan="9"><hr></td></tr>
					<tr>
						<td>Tank</td>
						<td>MOID</td>
						<td>Common Name</td>
						<td>Size</td>
						<td>Reason</td>
						<td>Related Trans</td>
						<td align="right">Date Reject</td>
						<td align="right">Quantity</td>
						<td align="right">Reject Amt</td>
					</tr>
					<tr><td colspan="9"><hr></td></tr>
					<?php $_from = $this->_tpl_vars['rejectList']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['reject']):
?>
					<tr class="<?php echo smarty_function_cycle(array('values' => 'blue,notify'), $this);?>
">
						<td><?php echo $this->_tpl_vars['reject']['tank_name']; ?>
</td>
						<td><?php echo $this->_tpl_vars['reject']['moid']; ?>
</td>
						<td><?php echo $this->_tpl_vars['reject']['name']; ?>
</td>
						<td><?php echo $this->_tpl_vars['reject']['size']; ?>
</td>
						<td><?php echo $this->_tpl_vars['reject']['reason']; ?>
</td>
						<td><?php echo $this->_tpl_vars['reject']['last_transaction_source']; ?>
</td>
						<td align="right"><?php echo $this->_tpl_vars['reject']['reject_date']; ?>
</td>
						<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['reject']['quantity'])) ? $this->_run_mod_handler('number_format', true, $_tmp, "0%d") : number_format($_tmp, "0%d")); ?>
</td>
						<td align="right"><?php echo $this->_tpl_vars['reject']['currency_mark']; ?>
&nbsp;<?php echo ((is_array($_tmp=$this->_tpl_vars['reject']['amount'])) ? $this->_run_mod_handler('number_format', true, $_tmp, "2%d") : number_format($_tmp, "2%d")); ?>
</td>
					</tr>
					<?php endforeach; endif; unset($_from); ?>
					</table>
				</div>
            </div><!-- results -->
            
</div>
<script language="javascript">
	<?php echo '
	'; ?>

</script>